<include file="default/public/header_common" />

<ul class="am-list am-list-static address-list mt-1">
  <li><img src="__ROOT__/Apps/Wap/View/default/assets/i/i-address.png" width="26" height="26" /> 收货人信息</li>
  <li style="border-bottom: 1px dashed #eeeeee;">{$order['userName']} {$order['userPhone']}</li>
  <li style="border-top: 1px dashed #eeeeee;">{$order['userAddress']}</li>
</ul>
<div class="pro-list pro-item">
  <div class="pl-top"><span class="am-fr">{$order['createTime']}</span>订单号：{$order['orderNo']}</div>
  <div class="pl-top"><span class="c-red am-fr">
  	<if condition="$order['orderStatus'] == -2 ">待付款
    <elseif condition="$order['orderStatus'] == 0 "/>待发货
    <elseif condition="$order['orderStatus'] == 1 "/>待签收
    <elseif condition="$order['orderStatus'] == 2 "/>已完成
    </if>
  </span>商品数量：{$order['goodsNumber']}</div>
  <volist name="order['goods']" id="vo">
  <div class="am-g <if condition='$key != 0'>order-goods</if>">
    <div class="am-u-sm-4 am-list-thumb"> <a href="#" class=""><img src="<if condition="empty($vo['goodsThumbs'])">__PUBLIC__/images/default.jpg<else />/{$vo['goodsThumbs']}</if>" /></a> </div>
    <div class="am-u-sm-8 am-list-main">
      <h3 class="am-list-item-hd"><a href="#" class="c-333">{$vo['goodsName']}</a></h3>
      <div class="am-list-item-text"><span class="am-fr">数量：{$vo['goodsNumber']}</span>合作价：<span class="c-red">¥{$vo['shopPrice']}</span></div>
    </div>
  </div>
  </volist>
</div>
<div class="wrap-box mb-1 mt-1" style="padding-bottom: 1px;">
  <ul class="am-list am-list-static address-list mb-0">
    <li style="border-top: none;"><span class="am-fr">+¥{$order['postage']}</span>运费：</li>
    <if condition="$order['buyway'] == 3">
    <li style="border-top: none;"><span class="am-fr">+¥{$order['supPrice']}</span>鉴定费：</li>
    <li style="border-top: none;"><span class="am-fr">+¥{$order['supPostage']}</span>鉴定运费：</li>
    </if>
    <li><span class="am-fr">+¥{$order['totalMoney']}</span>商品总额：</li>
    <li style="border-bottom: none;"><span class="am-fr c-red fb">¥{$order['postage']+$order['totalMoney']+$order['supPrice']+$order['supPostage']}</span>总计：</li>
  </ul>
</div>
<div class="wrap-box mb-1" style="padding-bottom: 1px;">
  <ul class="am-list am-list-static pay-list mb-0">
  	<if condition="$order['buyway'] == 1">
    <li style="border-top: none;border-bottom: none;"><span class="am-fr">{$order['buywayName']}</span><span class="c-666">购买方式</span></li>
    <elseif condition="$order['buyway'] == 2"/>
    <li style="border-top: none;border-bottom: none;"><span class="am-fr">{$order['buywayName']}</span><span class="c-666">购买方式</span></li>
    <li style="border-top: none;border-bottom: none;">
    	已选择门店<br>
      <span class="f-small c-999">{$order['linestore']['storeName']}&nbsp;&nbsp;&nbsp;{$order['linestore']['storeTel']}<br>{$order['linestore']['province']}&nbsp;&nbsp;{$order['linestore']['city']}&nbsp;&nbsp;{$order['linestore']['district']}&nbsp;&nbsp;{$order['linestore']['storeTel']}</span></li>
    </li>
    <elseif condition="$order['buyway'] == 3"/>
    <li style="border-top: none;border-bottom: none;"><span class="am-fr">{$order['buywayName']}</span><span class="c-666">购买方式</span></li>
    </if>
  </ul>
</div>
<div class="wrap-box" style="padding-bottom: 1px;">
  <ul class="am-list am-list-static pay-list mb-0">
    <li style="border-top: none;"><span class="c-666">支付方式</span></li>
    <if condition="$order['orderStatus'] == -2 ">
    <li>
      <label class="am-radio am-fr" style="margin-top: 15px;">
        <input type="radio" name="payType" value="1" data-am-ucheck <if condition="$order['payType'] == 1">checked</if>>
      </label>
      <img src="__ROOT__/Apps/Wap/View/default/assets/i/i-card.png" width="40" height="40" class="am-fl mr-1" style="margin-top: .5rem;">余额支付<br>
      <span class="f-small c-999">直接余额支付</span></li>
    <li>
      <label class="am-radio am-fr" style="margin-top: 15px;">
        <input type="radio" name="payType" value="2" data-am-ucheck <if condition="$order['payType'] == 2">checked</if>>
      </label>
      <img src="__ROOT__/Apps/Wap/View/default/assets/i/i-alipay.png" width="40" height="40" class="am-fl mr-1" style="margin-top: .5rem;">支付宝支付<br>
      <span class="f-small c-999">快捷便利的在线支付</span></li>
      <?php if(isWeixin()) { ?>
    <li>
      <label class="am-radio am-fr" style="margin-top: 15px;">
        <input type="radio" name="payType" value="3" data-am-ucheck <if condition="$order['payType'] == 3">checked</if>>
      </label>
      <img src="__ROOT__/Apps/Wap/View/default/assets/i/i-weixin.png" width="40" height="40" class="am-fl mr-1" style="margin-top: .5rem;">微信支付<br>
      <span class="f-small c-999">快捷便利的在线支付</span></li>
      <?php } ?>
      <else />
      	  <if condition="$order['payType'] == 1">
          <li>
              <img src="__ROOT__/Apps/Wap/View/default/assets/i/i-card.png" width="40" height="40" class="am-fl mr-1" style="margin-top: .5rem;">余额支付<br>
              <span class="f-small c-999">直接余额支付</span></li>
              <elseif condition="$order['payType'] == 2"/>
            <li>
              <img src="__ROOT__/Apps/Wap/View/default/assets/i/i-alipay.png" width="40" height="40" class="am-fl mr-1" style="margin-top: .5rem;">支付宝支付<br>
              <span class="f-small c-999">快捷便利的在线支付</span></li>
              <elseif condition="$order['payType'] == 3"/>
            <li>
              <img src="__ROOT__/Apps/Wap/View/default/assets/i/i-weixin.png" width="40" height="40" class="am-fl mr-1" style="margin-top: .5rem;">微信支付<br>
              <span class="f-small c-999">快捷便利的在线支付</span></li>
          </if>
      </if>
      
      
    <!--<li style="border-bottom: none;">
      <label class="am-radio am-fr" style="margin-top: 15px;">
        <input type="radio" name="payType" value="" data-am-ucheck>
      </label>
      <img src="__ROOT__/Apps/Wap/View/default/assets/i/i-pay.png" width="40" height="40" class="am-fl mr-1" style="margin-top: .5rem;">银联支付<br>
      <span class="f-small c-999">快捷便利的在线支付</span></li>-->
  </ul>
</div>
<div data-am-widget="navbar" class="am-navbar am-cf navbar-bottom"	id="" style="padding: 0;">
  <ul class="am-navbar-nav am-cf am-avg-sm-2">
  	<if condition="$order['orderStatus'] == -2 ">
    <li style="text-align: left;"> 应付：<span class="c-red">¥{$order['postage']+$order['totalMoney']+$order['supPrice']+$order['supPostage']}</span> </li>
    <li style="text-align: right;"> <a href="javascript:cancleOrder({$order.orderId});" class="c-999" style="display: inline;font-size: 1.4rem;">取消订单</a>
      <button type="button" class="am-btn am-btn-warning am-radius am-btn-sm" onClick="toPay()">去付款</button>
    </li>
    <elseif condition="$order['orderStatus'] == 1 "/>
    <li style="text-align: left;"> 应付：<span class="c-red">¥{$order['postage']+$order['totalMoney']+$order['supPrice']+$order['supPostage']}</span> </li>
    <li style="text-align: right;"> 
      <button type="button" class="am-btn am-btn-warning am-radius am-btn-sm">确认收货</button>
    </li>
    <else />
    <li style="text-align: left;"> 应付：<span class="c-red">¥{$order['postage']+$order['totalMoney']+$order['supPrice']+$order['supPostage']}</span> </li>
    </if>
  </ul>
</div>
<div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-bd f-small"> 您确定要取该订单？ </div>
    <div class="am-modal-footer"> <span class="am-modal-btn" data-am-modal-cancel>取消</span> <span class="am-modal-btn" data-am-modal-confirm>确定</span> </div>
  </div>
</div>
<script src="__ROOT__/Apps/Wap/View/default/assets/js/jquery.min.js"></script> 
<script src="__ROOT__/Apps/Wap/View/default/assets/js/amazeui.min.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript">
function cancleOrder(id) {
	$('#my-confirm').modal({
		relatedElement: this,
		onConfirm: function() {
			$.post("{:U('Wap/UserOrder/cancelOrder')}",{orderId:id},function(data,textStatus){
				var json = MXC.toJson(data);
				if(json.code == 1) {
					window.location = "{:U('Wap/UserOrder/nopayList')}"
				} else {
					alert('删除失败！');
				}
			});
			
		},
		onCancel: function() {
		  
		}
	 });
}
function toPay() {
	var payType = $("input[name='payType']:checked").val();
	if(typeof(payType) =='undefined'){
	   alert("请选择支付方式!");
	   return;
	}
	window.location = "{:U('Wap/Order/wapToPay')}?orderSN={$order['orderNo']}&payType=" + payType;
}
</script>
</body>
</html>
